import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    children:[
      {
        //首页
        path: '/homeIndex',
        name: 'homeIndex',
        component: () => import('@/components/HelloWorld')
      }
      // 多少个二级菜单，需要添加多少个
    ]
  },
  {
    //登录页面
    path: '/login',
    name: 'Login',
    component: () => import('@/views/Login')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
